
import React from 'react';
import RouterView from '../../router/RouterView';
import { Layout, Menu} from 'antd';
import { useHistory } from 'react-router-dom'


const { Sider, Content } = Layout;
const { SubMenu } = Menu;
function SystemManage(props) {
    var {routes}=props;
    var history = useHistory()
    
    var handleClick=({ item, key, keyPath, domEvent })=>{
        history.push(key)
    }
    return (
        <Layout className='systemmanage'>
        <Sider>
            <h1>在线系统</h1>
            <Menu
                    mode="inline"
                    theme="light"
                    defaultSelectedKeys={['/index/systemManage/realtimedata']}
                    style={{ lineHeight: '64px' }}
                    onClick={handleClick}
                >
                    <Menu.Item key="/index/systemManage/realtimedata">实时数据</Menu.Item>

                    <SubMenu
                        key="1"
                        title={
                            <span>
                                
                                <span>历史数据</span>
                            </span>
                        }
                        >
                        <Menu.Item key="/index/systemManage/historydata">总览</Menu.Item>
                        <Menu.Item key="2">坐席报表</Menu.Item>
                        <Menu.Item key="3">留言报表</Menu.Item>
          
                    </SubMenu>
                </Menu>
        </Sider>
        <Content>
            {/* 渲染三级路由规则 */}
            <RouterView routes={routes}></RouterView>
        </Content>
</Layout>
    );
}

export default SystemManage;